package main

// Author : CSR丶WARRIOR
// Time ： 2020/10/13  9:49
// TOOLS : GoLand
// FILENAME : RecursionDemo1.go
// STATEMENT: 递归：计算阶乘

func factorial(num int) int {
	if num == 1 {
		return 1
	}
	return num * factorial(num-1)
}
func main() {
	println(factorial(5)) //120
}
